import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 04 - 16
 * Time: 22:51
 */
//求斐波那契数列的第n项(迭代实现)
public class test4 {
    public static int fibonacci(int n) {
        int a1 = 0;
        int a2 = 1;
        int a3 = 0;
        for (int i = 3; i <= n; i++) {//注意这里i的初始值为3
            a3 = a1 + a2;
            a1 = a2;
            a2 = a3;
        }
        return a3;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println(fibonacci(n));
    }
}
